<?PHP
class webButton extends webControl
{
	var $name = "";
	var $value = "";

	var $EventClick = "webButton.Click";

	function webButton($attrs)
	{
		parent::webControl($attrs);
		if (isset($attrs['name']))
		{
			$this->name = $attrs['name'];
		}
		if (isset($attrs['value']))
		{
			$this->value = $attrs['value'];
		}
	}
	function Render($writer)
	{
		$html = array("<input type=\"submit\"");
		$id = $this->getId();
		if ( !empty($id) )
		{
			array_push($html, " id=\"$id\"");
		}
		if ( !empty($this->name) )
		{
			array_push($html, " name=\"$this->name\"");
		}
		if ( !empty($this->value) )
		{
			array_push($html, " value=\"$this->value\"");
		}
		array_push($html, "/>\n");

		$writer->Write(implode('', $html));
	}
	function addClick($handler)
	{
		$this->addEventHandler($this->EventClick, $handler);
	}
	function removeClick($handler)
	{
		$this->removeEventHandler($this->EventClick, $handler);
	}
	function RiseEvents()
	{
		if ( $this->hasEvent($this->EventClick) )
		{
			$this->getEvent($this->EventClick)->call($this, array());
		}
	}
}
?>
